import { createMemoryHistory, createRouter } from 'vue-router';
import User from '../views/User.vue';
import Login from '../views/Login.vue';
import Posts from '../views/user/Posts.vue';
import Profile from '../views/user/Profile.vue'
const routes = [
    {
        path: '/',
        redirect: '/user/3'
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/user/:id',
        name: 'user',
        component: User,
        children:[
            {
                path: 'post',
                component: Posts
            },
            {
                path: 'profile',
                component: Profile
            }
        ]
    }
]
const router = createRouter({
    history: createMemoryHistory(),
    routes,
})
export default router;